package com.xyazm.fulfill.remote;


import com.xyazm.common.core.JsonResult;
import com.xyazm.common.utils.CheckResultUtil;
import com.xyazm.wms.api.IWmsApi;
import com.xyazm.wms.domain.param.PickGoodsParam;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

/**
 * wms服务远程接口
 * @author xuyou
 * 2022-11-20 22:00
*/
@Component
public class WmsRemote {


    /**
     * 库存服务
     */
    @DubboReference(version = "1.0.0", retries = 0)
    private IWmsApi wmsApi;

    /**
     * 仓储捡货
    */
    public void pickGoods(PickGoodsParam pickGoodsParam) {
        JsonResult<Void> result = wmsApi.pickGoods(pickGoodsParam);
        CheckResultUtil.checkResult(result,"仓储捡货");
    }

    /**
     * 取消捡货
     */
    public void cancelPickGoods(String orderId) {
        JsonResult<Void> result = wmsApi.cancelPickGoods(orderId);
        CheckResultUtil.checkResult(result,"取消拣货");
    }

}
